
package com.ami.kvm.imageredir;

import com.ami.kvm.jviewer.Debug;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteOrder;

public class Image {
	public static final byte SUCCESS = 0;
	public static final byte SECTOR_RANGE_ERROR = -1;
	public static final byte WRONG_MEDIA = -2;
	public static final byte MEDIUM_CHANGE = -3;
	public static final byte MEDIA_ERROR = -4;
	public static final byte NO_MEDIA = -5;
	public static final byte INVALID_PARAMS = -6;
	public static final byte UNREADABLE_MEDIA = -7;
	public static final byte REMOVAL_PREVENTED = -8;
	public static final byte UNSUPPORTED_COMMAND = -9;
	public static final byte DEVICE_PATH_TOO_LONG = -10;
	public static final byte DEVICE_ERROR = -11;
	public static final byte DEVICE_ALREADY_OPEN = -12;
	public static final byte MEDIUM_GETTING_READY = -14;
	public static final byte MEDIA_IN_USE = -15;
	public static int MAX_DEVICE_PATH_SIZE = 256;

	protected String imageFilePath = null;
	protected RandomAccessFile imageFile = null;
	protected long totalSectors;
	protected long blockSize;
	protected ByteOrder byteOrder;
	protected boolean opened = false;
	protected boolean mediaChange = false;

	FileReader fileReader = null;

	public boolean openImage(File paramFile, String paramString) {
		boolean bool = true;
		try {
			this.imageFile = new RandomAccessFile(paramFile, paramString);
			this.imageFilePath = paramFile.getPath();
		} catch (FileNotFoundException localFileNotFoundException) {
			Debug.out.println(localFileNotFoundException);
			bool = false;
		}
		return bool;
	}

	public void closeImage() {
		try {
			this.imageFile.close();
			this.imageFile = null;
		} catch (IOException localIOException) {
			this.imageFile = null;
			Debug.out.println(localIOException);
		}
	}

	public String getImageFilePath() {
		return this.imageFilePath;
	}

	public boolean setImageFilePath(String paramString) {
		boolean bool;
		if (paramString.length() < MAX_DEVICE_PATH_SIZE) {
			this.imageFilePath = paramString;
			bool = true;
		} else {
			bool = false;
		}
		return bool;
	}

	public RandomAccessFile getImageFile() {
		return this.imageFile;
	}

	public void setImageFile(RandomAccessFile paramRandomAccessFile) {
		this.imageFile = paramRandomAccessFile;
	}

	public long getTotalSectors() {
		return this.totalSectors;
	}

	public void setTotalSectors(long paramLong) {
		this.totalSectors = paramLong;
	}

	public long getBlockSize() {
		return this.blockSize;
	}

	public void setBlockSize(long paramLong) {
		this.blockSize = paramLong;
	}

	public ByteOrder getByteOrder() {
		return this.byteOrder;
	}

	public void setByteOrder(ByteOrder paramByteOrder) {
		this.byteOrder = paramByteOrder;
	}

	public boolean isOpened() {
		return this.opened;
	}

	public void setOpened(boolean paramBoolean) {
		this.opened = paramBoolean;
	}

	public boolean isMediaChange() {
		return this.mediaChange;
	}

	public void setMediaChange(boolean paramBoolean) {
		this.mediaChange = paramBoolean;
	}
}

/*
 * Location:
 * D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\kvm\imageredir\Image.class
 * Java compiler version: 5 (49.0) JD-Core Version: 0.7.1
 */